package tech.dongliang.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tech.dongliang.system.model.SysMenu;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author xdzhang
 * @since 2019-01-18
 */
public interface SysMenuDao extends BaseMapper<SysMenu> {
    @Select({
            "<script>",
            "SELECT perms FROM sys_menu WHERE id in ",
            "<foreach collection='menuIds' item='menuId' index='index' open='(' close=')' separator=','>",
            "#{menuId}",
            "</foreach>",
            "</script>"
    })
    Set<String> listPermsByIds(@Param("menuIds") List<Integer> menuIds) throws Exception;
}
